package com.zhsm.fuxi.mapmanager.mark;

import android.os.Bundle;
import android.view.View;

import com.baidu.mapapi.model.LatLng;

/**
 * @desc： mark的加载类
 */

public class MarkConfig {
    private int mImageResId;//图片的资源id
    private int mImageWidth;//图片的宽度
    private int mImageHeight;//图片的高度

    private View mMarkView;//加载mark的view
    private LatLng mLatLng;//经纬度
    private String mTitle; //设置的title
    private Bundle mExtraInfo; //设置的额外的bundle信息

    public MarkConfig(ImgBuilder builder) {
        this.mLatLng = builder.latLng;
        this.mImageResId = builder.imageResId;
        this.mImageWidth = builder.imageWidth;
        this.mImageHeight = builder.imageHeight;
        this.mTitle=builder.title;
        this.mExtraInfo = builder.extraInfo;
    }

    public MarkConfig(ViewBuilder builder) {
        this.mMarkView = builder.markView;
        this.mLatLng = builder.latLng;
        this.mTitle = builder.title;
        this.mExtraInfo = builder.extraInfo;

    }


    public int getImageResId() {
        return mImageResId;
    }

    public int getImageWidth() {
        return mImageWidth;
    }

    public int getImageHeight() {
        return mImageHeight;
    }

    public View getMarkView() {
        return mMarkView;
    }

    public LatLng getLatLng() {
        return mLatLng;
    }

    public String getTitle() {
        return mTitle;
    }

    public Bundle getExtraInfo() {
        return mExtraInfo;
    }

    public static ImgBuilder imgbuilder() {
        return new ImgBuilder();
    }

    public static ViewBuilder viewbuilder() {
        return new ViewBuilder();
    }

    public static final class ViewBuilder {
        private View markView;//加载mark的view
        private LatLng latLng;//经纬度
        private String title; //设置的title
        private Bundle extraInfo; //设置的额外的bundle信息

        public ViewBuilder setMarkView(View markView) {
            this.markView = markView;
            return this;
        }

        public ViewBuilder setLatLng(LatLng latLng) {
            this.latLng = latLng;
            return this;
        }

        public ViewBuilder setTitle(String title) {
            this.title = title;
            return this;
        }

        public ViewBuilder setExtraInfo(Bundle extraInfo) {
            this.extraInfo = extraInfo;
            return this;
        }

        public MarkConfig build() {
            return new MarkConfig(this);
        }
    }

    public static final class ImgBuilder {
        private int imageResId;//图片的资源id
        private int imageWidth;//图片的宽度
        private int imageHeight;//图片的高度
        private LatLng latLng;//经纬度
        private String title; //设置的title
        private Bundle extraInfo; //设置的额外的bundle信息

        public Bundle getExtraInfo() {
            return extraInfo;
        }

        public ImgBuilder setExtraInfo(Bundle extraInfo) {
            this.extraInfo = extraInfo;
            return this;
        }

        public ImgBuilder setLatLng(LatLng latLng) {
            this.latLng = latLng;
            return this;
        }

        public ImgBuilder setImageResId(int imageResId) {
            this.imageResId = imageResId;
            return this;
        }

        public ImgBuilder setImgeWidth(int imageWidth) {
            this.imageWidth = imageWidth;
            return this;
        }

        public ImgBuilder setImageHeight(int imageHeight) {
            this.imageHeight = imageHeight;
            return this;
        }

        public ImgBuilder setTitle(String title) {
            this.title = title;
            return this;
        }

        public MarkConfig build() {
            return new MarkConfig(this);
        }
    }


}
